<?php

class Silk_Pms_Block_Adminhtml_Activity_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
{

    public function __construct()
    {
        parent::__construct();
        $this->setId('pms_tabs');
        $this->setDestElementId('edit_form');
        $this->setTitle(Mage::helper('pms')->__('活动详情'));
    }

    protected function _beforeToHtml()
    {
        $this->addTab('form_section', array(
            'label'     => Mage::helper('pms')->__('活动详情'),
            'title'     => Mage::helper('pms')->__('活动详情'),
            'content'   => $this->getLayout()->createBlock('pms/adminhtml_activity_edit_tab_form')->toHtml(),
        ));

        $templateId = Mage::registry("activity_data")->getTemplateId();
        $checkActive = '';
        if($templateId){
            $checkActive = TRUE;
        }
        if($templateId){
            $this->addTab('form_section2', array(
                'label'     => Mage::helper('pms')->__('模板内容'),
                'title'     => Mage::helper('pms')->__('模板内容'),
                'content'   => $this->getLayout()
                    ->createBlock("pms/adminhtml_activity_edit_tab_template_$templateId")
                    ->toHtml(),
                'active'    => $checkActive,
            ));
        }

        return parent::_beforeToHtml();
    }

}